/**
 * Project Looking Glass
 *
 * $RCSfile: JInputEvent.java,v $
 *
 * Copyright (c) 2004-2007, Sun Microsystems, Inc., All Rights Reserved
 *
 * Redistributions in source code form must reproduce the above
 * copyright and this condition.
 *
 * The contents of this file are subject to the GNU General Public
 * License, Version 2 (the "License"); you may not use this file
 * except in compliance with the License. A copy of the License is
 * available at http://www.opensource.org/licenses/gpl-license.php.
 *
 * $Revision: 1.3 $
 * $Date: 2007/05/04 23:11:40 $
 * $State: Exp $
 */
package lionel.input;

/**
 * The base class for all JInput events
 *
 * @author Krishna Gadepalli
 */
public abstract class JInputEvent {

    /**
     * Device from which the event originated
     */
    protected JInputDevice device;

    /**
     * Component (on the device) from which the event originated
     */
    protected JInputComponent component;

    /**
     * The current polled value for the component
     */
    protected float value;

    protected JInputEvent(JInputDevice device, JInputComponent component, float value) {
	this.device = device;
	this.component = component;
	this.value = value;
    }

    public JInputComponent.ID getID() {
	return component.getID();
    }

    public String toString() {
	return device.getName() + ":" + component.getName() + "=" + value;
    }

    public float getValue() {
	return value;
    }
}
